package contents.entities;

import java.util.Comparator;

public class SubjectGrades {
    public static class ByStudentNameComparator implements Comparator {
        public int compare(Object object1, Object object2) {
            Subject subject1 = ((SubjectGrades) object1).getSubject();
            Subject subject2 = ((SubjectGrades) object2).getSubject();
            
            if (subject1.getName().equals(subject2.getName())) {
                return subject1.getYearClass().compareTo(subject2.getYearClass());
            } else {
                return subject1.getName().compareTo(subject2.getName());
            }
        }   
    }
    
    private int gradebookId;
    private Subject subject;
    private Student student;
    private String grades;

    public SubjectGrades(int gradebookId, Subject subject, Student student, String grades) {
        this.gradebookId = gradebookId;
        this.subject = subject;
        this.student = student;
        this.grades = grades;
    }    
      
    public int getGradebookId() {
        return gradebookId;
    }
    
    public Subject getSubject() {
        return subject;
    }
    
    public Student getStudent() {
        return student;
    }

    public String getGrades() {
        return grades;
    }
    
}
